<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <th:block th:include="include :: header('修改分组')" />
</head>
<body class="white-bg">

  <div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-mygroup-edit" th:object="${data}">
      <input name="version" th:field="*{version}" type="hidden" />
      <div class="form-group">
        <label class="col-sm-3 control-label is-required">分组名称：</label>
        <div class="col-sm-9">
          <input name="group" th:field="*{group}" class="form-control" type="text" readonly required />
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label is-required">Own User：</label>
        <div class="col-sm-9">
          <input name="ownUser" th:field="*{ownUser}" class="form-control" type="text" autocomplete="off" required />
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">Dev Users：</label>
        <div class="col-sm-9">
          <textarea rows="3" name="devUsers" class="form-control">[(*{devUsers})]</textarea>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">Alarm Users：</label>
        <div class="col-sm-9">
          <textarea rows="3" name="alarmUsers" class="form-control">[(*{alarmUsers})]</textarea>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-3 control-label">Web Hook：</label>
        <div class="col-sm-9">
          <input name="webHook" th:field="*{webHook}" class="form-control" type="text" autocomplete="off" />
        </div>
      </div>
    </form>
  </div>

  <th:block th:include="include :: footer" />
  <script th:inline="javascript">
    var prefix = ctx + "disjob/mygroup";

    $("#form-mygroup-edit").validate({
      focusCleanup: true
    });

    function submitHandler() {
      if ($.validate.form()) {
        $.operate.save(prefix + "/edit", $('#form-mygroup-edit').serialize());
      }
    }

    $(function () {
      if (![(${isOwnUser})]) {
        $("input[name='ownUser']").attr("readonly", "true")
      }
    });
  </script>

</body>
</html>
